<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib prefix="s" uri="/struts-tags" %>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
	/*****************样式1*******************/
 table.datagrid1{
  border-collapse: collapse;
  border-bottom: 1px solid #666;
 }
 table.datagrid1 th{
  color: #333;
  padding: 3px;
  font-family: monospace;
  background: #9cf;
  text-align: center;
  border-top: 1px solid #666;
  border-bottom: 1px solid #666;
 }
 table.datagrid1 td{
  padding: 3px;
  border-top: 1px solid #ccc;
 }

 tr:hover,
 tr.hover{
  background: #9cf;
 }
</style>
<script type="text/javascript">
function add_event(tr){
	   tr.onmouseover = function(){
	    tr.className += ' hover';
	   };
	   tr.onmouseout = function(){
	    tr.className = tr.className.replace(' hover', '');
	   };
	  }

	  function stripe(table) {
	   var trs = table.getElementsByTagName("tr");
	   for(var i=1; i<trs.length; i++){
	    var tr = trs[i];
	    tr.className = i%2 != 0? 'odd' : 'even';
	    add_event(tr);
	   }
	  }

	  window.onload = function(){
	   var tables = document.getElementsByTagName('table');
	   for(var i=0; i<tables.length; i++){
	    var table = tables[i];
	    table.className="datagrid1";
	    stripe(tables[i]);
	   }
	  } 
</script>
<title>试题选择</title>
<script type="text/javascript">
function selectPaper(id,val){
	window.opener.document.getElementById("paperId").value=id;
	window.opener.document.getElementById("paperName").value=val;
	window.close();
}
</script>
</head>
<body>
<table cellpadding="1" border="0" style="color:#333333; width:100%;" >
	<tr>
		<th width="10%" >编号</th>
		<th width="30%" >考试类型</th>
		<th width="30%" >试卷标题</th>
		<th width="15%" >出题方式</th>
		<th>操作</th>
	</tr>
	<s:if test="%{paperList.size()!=0}" >
		<s:iterator value="%{paperList}" id="paper" status="status"  >
			<tr>
				<td>&nbsp;<s:property value="#status.count" /></td>
				<td>在线考试</td>
				<td><s:property value="#paper.name" /></td>
				<td>随机出题</td>
				<td>
					<input type="reset" onclick="selectPaper('${paper.id}','${paper.name}')" value="选择" style="font-size: 9pt" />
				</td>
			</tr>
		</s:iterator>
	</s:if>
</table>
</body>
</html>